Skip to content

test/getrandom-fallbacks: fix open shim types#219

Merged
besser82 merged 1 commit intobesser82:developfrom
nwf:develop
Nov 22, 2025
Merged

test/getrandom-fallbacks: fix open shim types#219
besser82 merged 1 commit intobesser82:developfrom
nwf:develop

Conversation

@nwf
Copy link
Copy Markdown
Contributor

@nwf nwf commented Nov 22, 2025

In C, functions taking a variable number of arguments are not guaranteed to have the same calling convention as functions taking a fixed number of arguments 1. Since open() and open64() are defined as taking a variable number of arguments, the __wrap_open() and __wrap_open64() mocks must be as well.

This fixes the test on my powerpc64el machine building nixpkgs a8d610af3f1.

Footnotes

  1. C23 §6.7.7.4¶14 says: "For two function types to be compatible, both shall specify compatible return types. Moreover, the parameter type lists shall agree in the number of parameters and in use of the final ellipsis; corresponding parameters shall have compatible types."

In C, functions taking a variable number of arguments are not guaranteed to have
the same calling convention as functions taking a fixed number of arguments
[^0].  Since `open()` and `open64()` are defined as taking a variable number of
arguments, the `__wrap_open()` and `__wrap_open64()` mocks must be as well.

[^0]: C23 §6.7.7.4¶14 says: "For two function types to be compatible, both shall
specify compatible return types. Moreover, the parameter type lists shall agree
in the number of parameters and in use of the final ellipsis; corresponding
parameters shall have compatible types."

This fixes the test on my powerpc64el machine building nixpkgs a8d610af3f1.
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (292117d) to head (d6faad7).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #219   +/-   ##
========================================
  Coverage    90.12%   90.12%           
========================================
  Files           36       36           
  Lines         3767     3767           
  Branches       739      739           
========================================
  Hits          3395     3395           
  Misses         238      238           
  Partials       134      134           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@besser82
Copy link
Copy Markdown
Owner

Thanks for your contribution! This should at least partially fix #214.

@besser82 besser82 merged commit d6faad7 into besser82:develop Nov 22, 2025
90 checks passed
nwf pushed a commit to nwf/nixpkgs that referenced this pull request Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants